

public class Person {
	String name;
	int age;
	double weight;
	long personalNumber;
	boolean isMale;
	Person [] friends;
	double money;
	Car car;
	
	
	Person(){
		age=0;
		weight=4.0;
		this.friends=new Person[3];
	}
	
	
	Person(String name, long personalNumber,boolean isMale){
		this();
		this.name=name;
		this.personalNumber=personalNumber;
		this.isMale=isMale;
	
	}
	
	void buyCar(Car car){
		if (car!=null && money > car.price){
			this.car.brand=car.brand;
			money-=car.price;
		}
		else
			System.out.println("Not enough minerals");
	}
	
	void changeOwner(Person newOwner){
		car.owner.name=newOwner.name;
	}
	
	
	
	double sellCarForScrap(){
		money += car.calculateCarPriceForScrap(2.65);
		return money;
	}
		
	
//	Person(String name, int age){
//		this();
//		this.name=name;
//		this.age=age;
//	}
	
	public void growUp(){
		age++;
		System.out.print("Age: "+age);
	}
	
	public void eat(){
		System.out.println("You are full.");
	}
	
	public void walk(){
		System.out.println("You are somewhere else.");
	}
	
	public void drinkWater(double a){
		if (a<1){
		System.out.println("You drinked "+a+" liter!");
		}
		else{
			System.out.println("This is too much!");
		}
	}

}


